set nu


try
    source ~/.vim_runtime/my_plugins/plug.vim
catch
endtry

" 使用vim-plug管理vim组件
call plug#begin('~/.vim_runtime/my_plugins')

" 增加同级段落缩进连线
Plug 'Yggdroot/indentLine'

call plug#end()


" 显示空格为灰暗的点
" let g:indentLine_leadingSpaceChar='·'
" let g:indentLine_leadingSpaceEnabled='1'

" 打开不同的文件自动生成文件头
func SetComment_sh()
    call setline(1,"#!/bin/bash") 
	call setline(2,"")
    call setline(3,"# Description: ")
    call setline(4,"# File: " . expand("%:t") . " |Time: " .strftime("%Y-%m-%d %H:%M"))
    call setline(5,"")
    call setline(6,"")
endfunc

autocmd BufNewFile *.sh exec ":call SetComment_sh()"
autocmd BufNewFile *.sh exec ":3"


func SetComment_c()
    call setline(1,"/**")
    call setline(2," * Description: ")
    call setline(3," * File: " . expand("%:t") . " |Time: " .strftime("%Y-%m-%d %H:%M"))
    call setline(4," */")
    call setline(5,"")
endfunc


autocmd BufNewFile *.c exec ":call SetComment_c()"
autocmd BufNewFile *.c exec ":5"
autocmd BufNewFile *.cpp exec ":call SetComment_c()"
autocmd BufNewFile *.cpp exec ":5"

" 设置内核索引
set tags+=/usr/include/tags

